package cn.tedu.fy.pethome.service.impl;

import cn.tedu.fy.pethome.mapper.CategoryMapper;
import cn.tedu.fy.pethome.pojo.vo.CategoryListItemsVO;
import cn.tedu.fy.pethome.service.ICategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * 类别业务的实现类
 *
 * @author cl
 * @date 2022/7/29
 */
@Slf4j
@Service
public class CategoryServiceImpl implements ICategoryService {

    @Autowired
    CategoryMapper categoryMapper;

    @Override
    public List<CategoryListItemsVO> list() {
        log.debug("开始处理查询商品列表的业务");
        return categoryMapper.list();
    }

    @Override
    public List<CategoryListItemsVO> getListByParentId(Long id) {
        log.debug("开始处理查询子级列表的业务");
        return categoryMapper.getListByParentId(id);
    }
}
